package hu.cskassai.sad.business;

import hu.cskassai.sad.business.requests.ChangeAlgorithmRequest;
import hu.cskassai.sad.business.requests.ChangeGraphRequest;
import hu.cskassai.sad.business.requests.ChangeHeuristicRequest;
import hu.cskassai.sad.business.requests.SaveGraphRequest;
import hu.cskassai.sad.business.response.ChangeAlgorithmResponse;
import hu.cskassai.sad.business.response.ChangeGraphResponse;
import hu.cskassai.sad.business.response.ChangeHeuristicResponse;
import hu.cskassai.sad.business.vo.AlgorithmPropertyVO;
import hu.cskassai.sad.business.vo.GraphPropertyVO;
import hu.cskassai.sad.business.vo.HeuristicPropertyVO;
import hu.cskassai.sad.model.factory.DomainFactory;
import hu.cskassai.sad.model.graph.Vertex2D;

import java.awt.Paint;
import java.awt.geom.Point2D;
import java.util.Collection;

import org.apache.commons.collections15.Transformer;

import edu.uci.ics.jung.graph.Graph;

public interface GraphManager<V, E> {
	
	void step();
	
	ChangeGraphResponse changeGraph(ChangeGraphRequest request);
	
	ChangeHeuristicResponse changeHeuristic(ChangeHeuristicRequest request);
	
	ChangeAlgorithmResponse changeAlgorithm(ChangeAlgorithmRequest request);
	
	Graph<V, E> getGraph();
	
	void saveGraph(SaveGraphRequest reguest);
	
	public void saveEnvironment();
	
	void addAlgorithm(AlgorithmPropertyVO algorithmPropertyVO);
	
	void addHeuristic(HeuristicPropertyVO heuristicPropertyVO);
	
	String addGraph(GraphPropertyVO graphPropertyVO);
	
	public Collection<String> getAlgorithms();
	
	public Collection<String> getHeuristic();
	
	public Collection<String> getGraphs();
	
	public void setToTarget(final V vertex);
	
	public void setToStart(V vertex);
	
	Transformer<E, Paint> getEdgeColorTransformer();
	
	Transformer<V, Paint> getVertexColorTransformer();
	
	public DomainFactory getDomainFactory();
	
	public Transformer<V, Point2D> getVertexToPointTransformer();
	
	void deleteVertex(V vertex);
	
	void addVertex(Point2D location);
	
	void deleteEdge(E edge);
	
	void addEdge(V from, V to, Double weight);
	
	public int getTime();
	
	public int getActualMemory();
	
	public int getMaxMemory();
	
	public Collection<Object[]> getVertexProperties(Vertex2D vertex);
	
	public void newGraph();

	int getStepNumber();
	
}
